package com.Ajava1704.for设计模式.for动态代理.Cglib动态代理;

import javax.sound.midi.Soundbank;

/**
 * @类名: com.Ajava1704.for设计模式.for动态代理.Cglib动态代理
 * @作者: lgt
 * @创建时间: 2020-02-14 21:35
 * @描述:
 **/
public class ForTest002 {
    public static void main(String[] args) {
        //为接口创建代理实现
       /*
        ForMethodInterceptor<ForCglibInterface> objectForMethodInterceptor = new ForMethodInterceptor<>();
        ForCglibInterface proxyObject = objectForMethodInterceptor.getProxyObject(ForCglibInterface.class);
        System.out.println(proxyObject.test());
      */

       //为类创建代理实现
        TestObjectImpl testObject = new TestObjectImpl();
        ForMyMethodInterceptor2<TestObjectImpl> forMyMethodInterceptor2 = new ForMyMethodInterceptor2<>(testObject);
        TestObjectImpl objectProxy = forMyMethodInterceptor2.getObjectProxy(TestObjectImpl.class);
        System.out.println(objectProxy.test("hello tt"));
    }
}
